var e = require("../../../../config/index");
Component({
  properties: {
    userInfo: {
      type: Object,
      value: {
        uname: "",
        tel: 0,
        avatar: "",
        id: 0
      }
    }
  },
  data: {
    avatar: e.DEFAULT_AVATAR_URL,
    tel: "",
    defaultIcon: "https://staticscdn.zgzpsjz.com/miniprogram/images/wyl/image_userhead_64px.png"
  },
  observers: {
    userInfo: function (e) {
      this.setData({
        avatar: e.header,
        tel: "".concat(String(e.userPhone).slice(0, 3), "********")
      })
    }
  },
  methods: {
    goMemberPage: function () {
      1 != this.data.member_status && this.triggerEvent("goMemberPage")
    },
    goToEditInfo: function () {
      $.router.push("/subpackage/personal/info/index")
    },
    onImgError: function () {
      this.setData({
        avatar: e.DEFAULT_AVATAR_URL
      })
    },
    goToLogin: function () {
      $.router.push("/subpackage/login/auth/index")
    }
  }
});